<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>行内元素水平居中</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: red;
            color: #fff;
            text-align: center;
            /*line-height: 200px;*/

            /*相当于表格的td元素*/
            display: table-cell;
            vertical-align: middle;
        }
    </style>
</head>
<body>
<div class="box">
    <span>wujie</span>
</div>
</body>
</html>
